<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    div{
        width: 800px;
        height: 5px;
        position: relative;
        animation: myfirst 5s infinite;
    }
    @keyframes myfirst{
        0%{
            width: 0;
            top: 0px;
        }
        25%{
            width: 25%;
            top: 200px;
            background: skyblue;
        }
        50%{
            width: 50%;
            top: 50px;
            background: salmon;
        }
        75%{
            width: 75%;
            top: 100px;
            background: orangered;
        }
        100%{
            width: 100%;
            top: 20px;
            background: teal;
        }
    }
    </style>
</head>
<body>
    <div></div>
</body>
</html>